Optimal. Leaf size=59 \[ \frac{B (a \sin (e+f x)+a)^{m+2}}{a^2 f (m+2)}+\frac{(A-B) (a \sin (e+f x)+a)^{m+1}}{a f (m+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0705771, antiderivative size = 59, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.069, Rules used = {2833, 43} \[ \frac{B (a \sin (e+f x)+a)^{m+2}}{a^2 f (m+2)}+\frac{(A-B) (a \sin (e+f x)+a)^{m+1}}{a f (m+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2833
Rule 43
Rubi steps
\begin{align*} \int \cos (e+f x) (a+a \sin (e+f x))^m (A+B \sin (e+f x)) \, dx &=\frac{\operatorname{Subst}\left (\int (a+x)^m \left (A+\frac{B x}{a}\right ) \, dx,x,a \sin (e+f x)\right )}{a f}\\ &=\frac{\operatorname{Subst}\left (\int \left ((A-B) (a+x)^m+\frac{B (a+x)^{1+m}}{a}\right ) \, dx,x,a \sin (e+f x)\right )}{a f}\\ &=\frac{(A-B) (a+a \sin (e+f x))^{1+m}}{a f (1+m)}+\frac{B (a+a \sin (e+f x))^{2+m}}{a^2 f (2+m)}\\ \end{align*}
Mathematica [A] time = 0.122547, size = 51, normalized size = 0.86 \[ \frac{(a (\sin (e+f x)+1))^{m+1} (A (m+2)+B (m+1) \sin (e+f x)-B)}{a f (m+1) (m+2)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 1.661, size = 0, normalized size = 0. \begin{align*} \int \cos \left ( fx+e \right ) \left ( a+a\sin \left ( fx+e \right ) \right ) ^{m} \left ( A+B\sin \left ( fx+e \right ) \right ) \, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.49354, size = 169, normalized size = 2.86 \begin{align*} -\frac{{\left ({\left (B m + B\right )} \cos \left (f x + e\right )^{2} -{\left (A + B\right )} m -{\left ({\left (A + B\right )} m + 2 \, A\right )} \sin \left (f x + e\right ) - 2 \, A\right )}{\left (a \sin \left (f x + e\right ) + a\right )}^{m}}{f m^{2} + 3 \, f m + 2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 8.30572, size = 428, normalized size = 7.25 \begin{align*} \begin{cases} x \left (A + B \sin{\left (e \right )}\right ) \left (a \sin{\left (e \right )} + a\right )^{m} \cos{\left (e \right )} & \text{for}\: f = 0 \\- \frac{A}{a^{2} f \sin{\left (e + f x \right )} + a^{2} f} + \frac{B \log{\left (\sin{\left (e + f x \right )} + 1 \right )} \sin{\left (e + f x \right )}}{a^{2} f \sin{\left (e + f x \right )} + a^{2} f} + \frac{B \log{\left (\sin{\left (e + f x \right )} + 1 \right )}}{a^{2} f \sin{\left (e + f x \right )} + a^{2} f} + \frac{B}{a^{2} f \sin{\left (e + f x \right )} + a^{2} f} & \text{for}\: m = -2 \\\frac{A \log{\left (\sin{\left (e + f x \right )} + 1 \right )}}{a f} - \frac{B \log{\left (\sin{\left (e + f x \right )} + 1 \right )}}{a f} + \frac{B \sin{\left (e + f x \right )}}{a f} & \text{for}\: m = -1 \\\frac{A m \left (a \sin{\left (e + f x \right )} + a\right )^{m} \sin{\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} + \frac{A m \left (a \sin{\left (e + f x \right )} + a\right )^{m}}{f m^{2} + 3 f m + 2 f} + \frac{2 A \left (a \sin{\left (e + f x \right )} + a\right )^{m} \sin{\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} + \frac{2 A \left (a \sin{\left (e + f x \right )} + a\right )^{m}}{f m^{2} + 3 f m + 2 f} + \frac{B m \left (a \sin{\left (e + f x \right )} + a\right )^{m} \sin ^{2}{\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} + \frac{B m \left (a \sin{\left (e + f x \right )} + a\right )^{m} \sin{\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} + \frac{B \left (a \sin{\left (e + f x \right )} + a\right )^{m} \sin ^{2}{\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} - \frac{B \left (a \sin{\left (e + f x \right )} + a\right )^{m}}{f m^{2} + 3 f m + 2 f} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.32114, size = 211, normalized size = 3.58 \begin{align*} \frac{\frac{{\left (a \sin \left (f x + e\right ) + a\right )}^{m + 1} A}{m + 1} + \frac{{\left ({\left (a \sin \left (f x + e\right ) + a\right )}^{2}{\left (a \sin \left (f x + e\right ) + a\right )}^{m} m -{\left (a \sin \left (f x + e\right ) + a\right )}{\left (a \sin \left (f x + e\right ) + a\right )}^{m} a m +{\left (a \sin \left (f x + e\right ) + a\right )}^{2}{\left (a \sin \left (f x + e\right ) + a\right )}^{m} - 2 \,{\left (a \sin \left (f x + e\right ) + a\right )}{\left (a \sin \left (f x + e\right ) + a\right )}^{m} a\right )} B}{{\left (m^{2} + 3 \, m + 2\right )} a}}{a f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]